package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.WorkOrderFormEntity;
import com.xbongbong.saas.domain.entity.ext.WorkOrderFormEntityExt;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;
/**
 *
 * @author 魏荣杰
 * @date 2019/3/14 11:11
 * @since v1.0
 * @version v1.0
 */
@Repository
@Mapper
public interface WorkOrderFormDao {
    Integer insert(WorkOrderFormEntity entity);

    Integer update(WorkOrderFormEntity entity);

    List<WorkOrderFormEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    WorkOrderFormEntityExt getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    WorkOrderFormEntityExt getByTemplateId(@Param("templateId") Long templateId, @Param("corpid") String corpid);

    List<WorkOrderFormEntityExt> findEntitysExt(@Param("param") Map<String, Object> param);

    /**
	 * 批量初始化
	 * @param list
	 * @param corpid
	 */
	Integer initBatch(@Param("list") List<WorkOrderFormEntity> list, @Param("corpid") String corpid);
    /**
     * 批量更新关联列表
     * @param list
     * @param corpid
     * @return
     */
    Integer updateBatch(@Param("list") List<WorkOrderFormEntity> list, @Param("corpid") String corpid);
    /**
     * 批量插入实体
     * @param list
     * @return 返回数据的列表
     */
    Integer insertBatch(@Param("list") List<WorkOrderFormEntity> list);
    /**
     * 批量删除
     * @param list 主键id集合
     * @param corpid
     * @author xingxing.xiao
     */
    Integer deleteBatch(@Param("list") List<Long> list, @Param("corpid") String corpid);

    WorkOrderFormEntityExt getByKeyIncludeDel(@Param("key") Long key, @Param("corpid") String corpid);
}
